package com.jfinal.weixin.demo.xingshi;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

/**
 *
 * http://avatardata.cn/Docs/Api/7fd9b74b-f051-4751-9f9e-26da8bcc674e
 * Created by wangxiaoyang on 16/8/28.
 */
public class XingshiBean {

    public String error_code = "";
    public String reason = "";
    public Item result;

    public String format() {
        if (null == result) {
            return "百家姓查询失败";
        }
        StringBuffer xingshi = new StringBuffer();
        xingshi.append(result.xing);
        xingshi.append(" ");
        Document document = Jsoup.parse(result.intro);
        xingshi.append(document.text());
        return xingshi.toString();
    }

    public static class Item {
        public String xing = "";
        public String intro = "";
    }
}
